package com.zyy;

/**
 * @ProjectName: concurrent
 * @Package: com.zyy
 * @ClassName: StartAndRun
 * @Author: ZHAYUYAO
 * @Description: 线程start和run的区别
 * @Date: 2019/9/15 21:35
 * @Version: 1.0
 */
public class StartAndRun {
    static class Mythread extends Thread{
        public Mythread(String name) {
            super(name);
        }

        @Override
        public void run() {
            System.out.println("current thread name : "+Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) {
        Mythread mythread = new Mythread("zyy");
        //结果为 current thread name : main
        mythread.run();
        //结果为 current thread name : zyy
//        mythread.start();
    }
}
